Low Thrust 2D Orbital Trajectory Optimization

Ian Ruh

This originated as my final project for the Intro to Optimization course at UW Madison, with Prof. Stephen Wright.

The Jupyter notebook is available here.


1. Introduction

Since the first satellites were launched in the late 1950s, engineers and scientists have had to navigate the unfamiliar dynamics of orbital mechanics. The process of getting from point A to point B while in orbit is not an intuitive exercise for someone unfamiliar with how orbital mechanics works because it appears to disobey the laws of physics we are accustomed to in our everyday life.

For example, to launch a rocket, one may think that the objective is to go up so as to get into orbit; after all, the rockets are pointed directly vertical on the launch pads. Yet, the really important factor that determines whether you will stay in space once you have gotten there is how fast you are going sideways. Likewise, if you want to go from one orbit to another orbit, the most natural thing to do is point your rocket in that direction and hit the throttle (and hope any Kerbals get out or your way). That, however, is likely a very inefficient and resource intensive trajectory.

The problem of determining the most efficient way to get from one orbit to another is compounded by the variety of different propulsion systems used on different craft. On the low end (thrust-wise), we have solar sails that use the radiation pressure from the sun (or lasers on earth in some concepts) to alter their velocity. One such example was Mariner 3 (and 4) spacecrafts that used 4 'flaps' on the end of their solar panels to alter the surface area that was presented to the sun, and thus were able to use the radiation pressure for attitude control. Another more recent example is the Planetary Society's crowd-funded Light Sail 2 craft that was launched in 2019. Using a 32 square meter sail, it is able to get an acceleration of 0.058 mm/s2. On the other end of the spectrum we have large chemical rockets in the ilk of the N1, Saturn V, and more recently, super heavy launch vehicles including Starship and New Glenn, which can produce millions of pounds of thrusts and launch multiple tons into LEO and beyond.

The most effective (and feasible) trajectories for these vehicles are drastically different. Both in terms of how large a thrust some can provide, and by the fact that most chemical combustion rocket engines have a minimum thrust that if gone below can damage the engine, while other propulsion technologies, including ion thrusters, have fairly low thrusts but can sustain them for very long periods of time.

In this project we look at two of the primary trade offs considered in determining trajectories in the context of a (relatively) low thrust propulsion system: time and fuel.

2. Mathematical Model

For the sake of tractability, the problem has been restricted to considering one body orbiting a much larger body (e.g. a satellite orbiting earth) in a single orbital plane. By limiting ourselves to a single plane, we are able to remove almost half of the orbital parameters that are typically used to define a 3D orbit around a body. Moreover, several additional factors are ignored, including (non-exhaustively) atmospheric effects, gravitational perturbations, and torques due to Earth's bulges.

By making these assumptions, we end up with the dynamics equations below:

r˙=vr

θ˙=vtr

vr˙=vt2rμr2+u sin(ϕ)

vt˙=vtvrr+u cos(ϕ)

Where our state variables are radius (r), phase (θ), radial velocity (vr), and tangential velocity (vt). And our control variables are thrust angle (ϕ), and thrust magnitude (u). One additional factor that we ignore is the change in mass as the craft's fuel is depleted.

One significant factor we have to consider here is the gravitational constant μ. In SI units, this has a value of 6.67431011Nm2kg2. However, we represent decimal numbers using floating point numbers, which lose accuracy at very small or very large scales. If we were to use SI units in our analysis, we would be multiplying a very small number ( 1011) by a very large number (the radius of the orbit in meters). This is a recipe for large numerical errors. Instead, we define the unit system we use such that the gravitational constant μ=1. That way, all of the numbers we are dealing with remain on the order of magnitude of 1, where floating point numbers are the most dense, and thus retain the most accuracy.

Discretization

We also need to choose a method of discretizing our system. We initially show the results of using the simplest approach to our integration scheme in the first section below, and then proceed with using a much more accurate scheme.

The simplest scheme is forward Euler method where 01f(x)f(x0)+f(x1)2Δx. This is only a first order accurate scheme, though, and so has limited use for us as demonstrated in the next section.

However, there are many higher order schemes that we can use to increase the accuracy and stability of our model. The scheme we chose here is to use cubic Hermite interpolating polynomials, and integrate those over the domain from 0 to 1. Any cubic polynomial can be uniquely defined by four points, just as a quadratic can be uniquely defined by three, and a line by two. However, we can also uniquely define a cubic polynomial using only two points, and the values of the derivative of the polynomial at those points. The graphs below demonstrate this for several different cases.

png

There are two primary reasons these polynomials are useful to us:

  1. By having control over the derivatives of the polynomials at the end points we are able to make sure that all of our trajectories will be smooth. If the spacecraft in our model is moving at 10 m/s at the end of one segment, it shouldn't be moving at 11 m/s at the beginning of the next, as this would be an unrealistic discontinuity in the model.
  2. The second reason is that it is very easy to integrate these polynomials. Because they are uniquely defined by the values and derivatives at the two endpoints, the integral over the polynomial from 0 to 1 is also easily expressed in terms of these values:

01(2t33t2+1)y0+(t32t2+t)dxdy|x=0+(2t3+3t2)y1+(t3t2)dxdy|x=1dt=12y0+12y1+112dxdy|x=0112dxdy|x=1

01f(t)dty02+y12+d012d112

Using this integration scheme we can achieve a much more accurate and stable system.

Problem Model

Our mathematical model for the fuel optimal problem is:

(1)minimizeu,ϕ,θ,r,vr,vtRnuisubject to:ri0i=1,,N0uiumaxi=1,,N0ϕi2πi=1,,Nr1=rinitvt,1=vt,initθ1=θinitvr,1=vr,initrN=rfinalvt,N=vt,finalvr,N=vr,final

Where the constraints can be explained as follows:

In addition, we have a series of N additional sets of constraints for the dynamics of the problem. Below is the first set of constraints for the dynamics, but they only change in the variable indexing for all other steps.

(2)r1r0=Δt[vr2|t=0+vr2|t=1+ar12|t=0ar12|t=1]θ1θ0=Δt[vt2r|t=0+vt2r|t=1+112(atrvtvrr2)|t=0112(atrvtvrr2)|t=1]vr,1vr,0=Δt[12(vt2rμr2+usin(ϕ))|t=0+12(vt2rμr2+usin(ϕ))|t=1]+Δt[112(2vtatrvt2vrr2+2μvrr3+u1u0Δtsin(ϕ)+uϕ1ϕ0Δtcos(ϕ))|t=0]Δt[112(2vtatrvt2vrr2+2μvrr3+u1u0Δtsin(ϕ)+uϕ1ϕ0Δtcos(ϕ))|t=1]vt,1vt,0=Δt[12(vrvtr+ucos(ϕ))|t=0+12(vrvtr+ucos(ϕ))|t=1]+Δt[112(vr2vtr2vrat+arvtrusin(ϕ)ϕ1ϕ0Δt+u1u0Δtcos(ϕ))|t=0]Δt[112(vr2vtr2vrat+arvtrusin(ϕ)ϕ1ϕ0Δt+u1u0Δtcos(ϕ))|t=1]

You may have guessed based on the dynamics constraints, but our optimization problem turns out to be non-linear.

3. Solution

Utility Functions

We first define some utility functions below.

First Order Method

In this example we demonstrate the limitations of using a first order accurate integration scheme. Refer to the comments for a description of what each line/section does.

Now, after defining our model, we can run it. We look at a trajectory starting at a radius of two and raising it to three.

png

 

png

Saving some more in depth discussions of the results here for when we get more accurate trajectories in the next section, we'll just note a couple of items.

Next, we'll demonstrate the instability in our current model by just increasing our simulation time a little bit. In the previous run, we used N=100 and T=12.0, so our time step was Δt0.12. When numerically integrating a function, as we are doing in our model, the time step is one of the parameters that controls whether your scheme is stable. Large time steps, when coupled with fast dynamics, lead to significant error that can build up over the simulation lifetime and lead to meaningless results. If you decrease your time step, you can control that error, but at the cost of having to make more calculations to simulate the same time period. In this demonstration, we use a time step only slightly larger, at Δt0.16.

If you look at the output above closely, you'll see that the solver didn't actually converge to a solution. We can still look at its outputs though and see where it ended up:

png

Clearly this doesn't seem likely to be a good prediction of reality. It probably also violates several laws of physics if we cared to do the math.

This is just to show the importance of the numerical scheme used in the model. In the next section we construct a very similar model, but use the higher order integration scheme described before, namely integrating cubic Hermite interpolating polynomials. Note the time steps we used above (on the order of 0.1) to the ones we can use below.

Hermite Interpolation

Below we construct the model using the integration scheme described in the introduction, and using a fuel optimal or a pseudo-time optimal objective function, which is discussed in the results section.

Fuel Optimal

We do a fuel optimal transfer orbit from a height of 2 to a height of 6. Notice, we also use a time step of 1.5, 15 times larger than for the simple integration scheme, and this isn't even very close to the limit of the model's stability.

png

 

png

We can assess the optimality of this trajectory based on the qualitative shape of the thrust profile. Due to the nature of the system's dynamics, it is most efficient to raise the apoapsis while at the periapsis, and it is most efficient to raise the periapsis while at the highest apoapsis. These two factors contribute to making the optimal thrust profile a 'bang bang' profile, where there is a thrust arc around every periapsis, and then a few thrust arcs near the highest apoapsis to circularize the orbit.

By the nature of how we structured the problem, this is a fuel optimal transfer trajectory subject to a maximum time of 300.0. In the next section we explore how we can get time optimal trajectories, with varying degrees of success.

Time Optimal

The problem modeled below is very similar to the problem laid out in the fuel optimal case. However, we now just make the time step size one of the variables we optimize over, and try to minimize Δtui+λΔt, where λ is an adjustable parameter to go between more fuel optimal, and more time optimal.

png

 

png

We clearly are getting a much faster time to orbit, at the cost of higher fuel usage. However, this model of the problem seems to have many local minima. This cannot be the global optimum of the model, as the model keeps running once it has reached its final orbit. If it was at the global minimum, then it would stop once it reached the final orbit.

As such, we also investigated a penalty method for finding a pseudo time optimal orbit based on the fuel optimal model.

Pseudo Time Optimal

Below we use a penalty objective for the fuel optimal model that penalizes proportional to the distance the trajectory is at every time step from the final orbit radius.

png

 

png

We can clearly see that without the time penalty included in the objective, the model tries to get to orbit much faster by thrusting almost continuously the whole way. The details of this trajectory, and the study of different penalty multipliers hat follows, are discussed in the results section.

Pseudo Time Optimal

WARNING The next cell will take a bit to run. Usually takes about 3 minutes.

png

 

png

 

png

 

png

 

png

 

png

 

png

 

png

 

png

 

png

 

png

 

png

 

png

 

png

 

png

 

png

 

png

 

png

 

png

 

png

 

png

 

png

 

png

 

png

 

png

 

png

4. Results and Discussion

Fuel Optimal Problem

The solutions we found for the fuel optimal transfer trajectory very closely match what we expect based on our intuitive explanations of the physics (when and where can we most efficiently thrust in our orbit) and match the results obtained by others on this problem. Shown below is the fuel optimum transfer trajectory obtained by Topputo and Zhang in their paper "Survey of Direct Transcription for Low-Thrust Space Trajectory Optimization with Applications" in figure 15.

There are several parts of the model that we assumed:

Despite these assumptions, we expect our method, if not the exact trajectories, to optimize to physically and technologically realizable situations.

One important factor in the ability of our model to converge is the starting conditions. We set the starting conditions for each model to be a circular orbit at the initial altitude, so if the optimizer didn't change any variable, the problem would already satisfy all the dynamics constraints, and only violate the final condition constraints. Using these starting points we are able to consistently get the model to converge to at least local minima. Initially we did not set starting values, so they started at random values; this was consistently causing issues as the optimizer was rarely able to converge to realistic trajectories.

Time Optimal Problem

The truly time optimal model, where we made the time step Δt one of our variables we optimize over, is not very stable. In some limited cases we are able to get coherent trajectories that seem plausible from it, but in most cases the model converges on an unrealistic local minimum trajectory.

I suspect this is a combination of the extremely non-linear dynamics constraints and the form of the objective function such that it remains numerically stable. The truly physically relevant form of the objective function, one which does not depend on the number of time segments we choose to use to model the problem, seems to be particularly unstable. We were able to stabilize it a bit more by letting it implicitly depend on the number of time segments in the model, but even so, it was very inconsistent.

Because this approach presented so many problems, we also tried, and found great success with, the pseudo time optimal formulation of the problem.

Pseudo Time Optimal Problem

Compared to the time optimal model of the problem, we were able to retain the consistent stability of the fuel optimal problem while also letting us move between fuel and time optimal trajectories according to a single parameter of the problem.

I have several main observations about our results:

5. Conclusion

Our findings are discussed in the previous section. There are a large number of possible directions we could take this in the future, including:

In the case of the multiple body systems, I believe we would have to resort to Cartesian coordinates, which would make our dynamics much uglier than they are now. I don't believe we would be able to super impose multiple polar coordinate systems and get the physics to work out for us.

The 3D orbit problem would just be the addition of a couple more dynamics constraints and state variables, and should be readily doable.